#include <iostream>
using namespace std;
void example_p47();
void example_p47_2();
void example_p48();
void example_p49();
void example_p50();
void example_p52();
int *ptr=nullptr;
int i=10;
int *ptr1;
int main()
{
	//example_p47();
	//example_p47_2();
	//example_p48();
	//example_p49();
	//example_p50();
	example_p52();
	return 0;
}
void example_p47()
{
	double dp=8.9;
	double *ip=&dp;
	double &rp=dp;
	cout<<&dp<<" "<<ip<<" "<<&ip<<" "<<&rp<<endl;
}
void example_p47_2()
{
	double dval=1.7;
	double *pd=&dval;
	double *pd2=pd;
	cout<<&dval<<" "<<&pd<<" "<<&pd2<<" "<<*pd2<<endl;
}
void example_p48()
{
	//int *p=&42;
	//不允许:从右边取地址符的作用者去理解:
	//取地址符作用的是一个对象，对象是指能够存储数据并有某种类型的内存空间
	//字面值不是对象
} 
void example_p49()
{
	int *pi;

}
void example_p50()
{
	double obj=3.14;
	void *pv=&obj;
	//*pv=3.1415;
	//编译报错提示:'void* is not a pointer-to-object type'
	cout<<obj<<endl;
}
void example_p52()
{
	int ival=4;
	int *pi=&ival;
	int **ppi=&pi;
	cout<<"&pi:"<<&pi<<" pi:"<<pi<<" *pi:"<<*pi<<" &ival:"<<&ival
	<<" &ppi:"<<&ppi<<" ppi:"<<ppi<<" *ppi:"<<*ppi<<" **ppi:"<<**ppi<<endl;
}